using System.Configuration;

namespace Rioshu.Web.ViewStateHandlers
{
    public class TinyPagePersisterConfigurationHandler : ConfigurationSection
    {
        [ConfigurationProperty("fieldName", DefaultValue = "__VSTATE")]
        public string FieldName
        {
            get { return this["fieldName"].ToString(); }
        }

        [ConfigurationProperty("compressionType", DefaultValue = CompressionType.GZip)]
        public CompressionType CompressionType
        {
            get { return (CompressionType) this["compressionType"]; }
        }

        public static TinyPagePersisterConfigurationHandler GetConfiguration()
        {
            return
                ConfigurationManager.GetSection("viewStateHandlers/tinyPagePersister") as
                TinyPagePersisterConfigurationHandler;
        }
    }
}